using System.Collections.Generic;

namespace Quiki.Templates
{
    public class TemplatesRegistry
    {
        public bool HasTemplate (string templateName)
        {
            return templates.ContainsKey(templateName);
        }

        public IWikiTemplate GetTemplate (string templateName)
        {
            return templates[templateName];
        }

        public void RegisterTemplate (IWikiTemplate wikiTemplate)
        {
            templates.Add (wikiTemplate.TemplateName, wikiTemplate);
        }

        private Dictionary<string, IWikiTemplate> templates = new Dictionary<string, IWikiTemplate> ();        
    }
}